﻿@using TSites.Administrator.Extensions
@model TSites.Administrator.Models.UserMgmtSearchViewModel
@{
    ViewBag.Title = "Index";
}
<link href="@Url.Stylesheet("jquery.alerts.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Script("/TSAdmin/jquery.alerts.js")" type="text/javascript"></script>

<script type="text/javascript">
	$(document).ready(function () {
		$.get(getAction(),
			getData(),
			function (data) {
				$("#divData").html(data).show();
			});
	});

	function getData() {
		var data = $("#frmSearch").serialize();
		data += "&curPage=1&pageSize=10";
		return data;
	}

	function getAction() {
		var action = $("#frmSearch").attr('action');
		return action;
	}
</script>

@using (Html.BeginForm("Search", "UserManagement", FormMethod.Get, new { id = "frmSearch" }))
{
	<fieldset>
		<legend>Search parameters
			<table>
				<tr>
					<td>@Html.LabelFor(m => m.UserId)</td>
					<td>@Html.TextBoxFor(m => m.UserId)</td>
					<td>@Html.LabelFor(m => m.UserName)</td>
					<td>@Html.TextBoxFor(m => m.UserName)</td>
				</tr>
				<tr>
					<td>@Html.LabelFor(m => m.Email)</td>
					<td>@Html.TextBoxFor(m => m.Email)</td>
					<td>@Html.LabelFor(m => m.ActiveCode)</td>
					<td>@Html.TextBoxFor(m => m.ActiveCode)</td>
				</tr>
				<tr>
					<td></td>
					<td>
						<input type="button" value="Search" />
						<input type="reset" value="Reset" />
					</td>
				</tr>
			</table>
		</legend>
	</fieldset>	
}

<br /><br /><br /><br /><br /><br />
<div id="divData"></div>

@Html.ActionLink("Add New", "Add", "UserManagement")